#include "OptionTypeString.h"
using namespace inilib;


OptionTypeString::OptionTypeString (
	const std::string & optionName,
	Mandatory isMandatory,
	ValuesAmount amount,
	const std::string & defaultValue,
	unsigned long long minLength,
	unsigned long long maxLength,
	char separator
)
	: OptionType( optionName, isMandatory, amount, separator )
{
	m_MinLength = minLength;
	m_MaxLength = maxLength;
	m_DefaultValue.push_back( defaultValue );
}


std::vector< std::string > OptionTypeString::GetDefaultValue () const
{
	return m_DefaultValue;
}


bool OptionTypeString::AreValuesValid_ ( const std::vector< std::string > & values ) const
{
	for ( size_t i = 0; i < values.size(); ++i )
	{
		if (
			values[ i ].length() < m_MinLength ||
			values[ i ].length() > m_MaxLength
			)
		{
			return false;
		}
	}

	return true;
}
